package struts2.action;

import java.util.ArrayList;

import com.opensymphony.xwork2.ActionSupport;

import DAO.Dao_addService;
import Entity.Services;

public class ListServiceAction extends ActionSupport {
	private ArrayList<Services> list;
	private int id;
	private String sv_name;
	private Services sv; 

	public Services getSv() {
		return sv;
	}

	public void setSv(Services sv) {
		this.sv = sv;
	}

	public String getSv_name() {
		return sv_name;
	}

	public void setSv_name(String sv_name) {
		this.sv_name = sv_name;
	}

	public ArrayList<Services> getList() {
		return list;
	}

	public void setList(ArrayList<Services> list) {
		this.list = list;
	}

//	public String active() {
//		int kq = Dao_addService.active(sv_name);
//		if (kq > -1){
//			sv = Dao_addService.getServices(sv_name);
//			return SUCCESS;
//		}
//		else
//			return ERROR;
//	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		list = Dao_addService.getList();
		return SUCCESS;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String copy() {
		Services x = list.get(id);
		return SUCCESS;
	}
}
